<table width="100%"><tr><td width="20%">
<a href="../index.html">&lt; index</a><br />
<a href="index.html">&lt; 2. Console</a><br />
<a href="console_keyboard.html">&lt; 2.3 Handling keyboard input</a>
</td><td width="60%">
<p align="center">
=====================================<br />
2.3.4 Keyboard event structure<br />
=====================================<br />
</p></td><td width="20%">
</td></tr></table>
<style type="text/css">
.code { color:#444444; background-color:#EEEEEE;}
pre { color:#444444; background-color:#EEEEEE;}
table.param td { border : 1px solid #000000; }
th { background-color: #44BBFF; color: #FFFFFF }
table.none td { border : 0 }
</style>
<p class="code"><pre>
typedef struct {
	TCOD_keycode_t vk;
	char c;
	unsigned pressed : 1;
	unsigned lalt : 1;
	unsigned lctrl : 1;
	unsigned ralt : 1;
	unsigned rctrl : 1;
	unsigned shift : 1;
} TCOD_key_t;
</pre></p>
<br />
This structure contains information about a key pressed/released by the user. 
<table class="param">
<tr><th>Field</th><th>Description</th></tr>
<tr><td>vk</td><td>An arbitrary value representing the physical key on the keyboard. Possible values are stored in the <a href="keycode_t.html">TCOD_keycode_t</a> enum. If no key was pressed, the value is <a href="keycode_t.html">TCODK_NONE</a></td></tr>
<tr><td>c</td><td>If the key correspond to a printable character, the character is stored in this field. Else, this field contains 0.</td></tr>
<tr><td>pressed</td><td>1 if the event is a key pressed, or 0 for a key released.</td></tr>
<tr><td>lalt</td><td>This field represents the status of the left Alt key : 1 =&gt; pressed, 0 =&gt; released.</td></tr>
<tr><td>lctrl</td><td>This field represents the status of the left Control key : 1 =&gt; pressed, 0 =&gt; released.</td></tr>
<tr><td>ralt</td><td>This field represents the status of the right Alt key : 1 =&gt; pressed, 0 =&gt; released.</td></tr>
<tr><td>rctrl</td><td>This field represents the status of the right Control key : 1 =&gt; pressed, 0 =&gt; released.</td></tr>
<tr><td>shift</td><td>This field represents the status of the shift key : 1 =&gt; pressed, 0 =&gt; released.</td></tr>
</table>
<br />
